<template>
    <div>
        <NavBar>全部分类</NavBar>
        <CategoryList
        :games = "cate"
        ></CategoryList>
        <router-link to="/category/list">进入二级页面</router-link>
    </div>
    
</template>

<script>
import CategoryList from "../components/CategoryList"
export default {
    components:{
        CategoryList
    },
    data: function () {
        return{
             cate: []
        }
       
    },
    mounted: function () {
        this.typeList()
    },
    methods: {
        typeList: function () {
            this.$ajax.get("douyu/api/RoomApi/game")
                .then(res =>{
                    console.dir(res.data)
                    this.cate = this.cate.concat(res.data.data)
                })
        }
    }
}
</script>

<style scoped>

</style>